using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace CodeStory.SmartUpload.WebControls
{
	public class UploadFile
	{
		string name;

		public string Name {
			get { return name; }
			set { name = value; }
		}
		string clientFileName;

		public string ClientFileName {
			get { return clientFileName; }
			set { clientFileName = value; }
		}
		string mimeType;

		public string MimeType {
			get { return mimeType; }
			set { mimeType = value; }
		}
		string tempFileName;

		public string TempFileName {
			get { return tempFileName; }
			set { tempFileName = value; }
		}

		public void Delete() {
			if (!File.Exists(TempFileName)) return;
			try {
				File.Delete(TempFileName);
			} catch {
			}
		}

		public void CopyTo(string targetFileName) {
			CopyTo(targetFileName,true);
		}

		public void CopyTo(string targetFileName, bool overwrite) {
			if (!File.Exists(TempFileName)) return;
			try {
				File.Copy(TempFileName, targetFileName, overwrite);
			} catch {
			}
		}
	}
}
